/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * EmptyPanelForDialog.java
 *
 * Created on 06.07.2009, 22:20:10
 */

package ru.vsu.cs.piit.vokod.view;

import java.awt.Container;
import java.awt.event.ActionListener;

/**
 *
 * @author Галчонок
 */
public class EmptyPanelForDialog extends javax.swing.JPanel {

    /** Creates new form EmptyPanelForDialog */
    public EmptyPanelForDialog() {
        initComponents();
    }

    void addCancelActionListener(ActionListener l) {
        jCancelBtn.addActionListener(l);
    }

    void addOkActionListener(ActionListener l) {
        jOkBtn.addActionListener(l);
    }

    void setContentPane(Container content) {
        this.setSize(content.getPreferredSize().width, content.getPreferredSize().height+30);
        this.jContentPanel.add(content);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jOkBtn = new javax.swing.JButton();
        jContentPanel = new javax.swing.JPanel();
        jCancelBtn = new javax.swing.JButton();

        jOkBtn.setText("OK");

        javax.swing.GroupLayout jContentPanelLayout = new javax.swing.GroupLayout(jContentPanel);
        jContentPanel.setLayout(jContentPanelLayout);
        jContentPanelLayout.setHorizontalGroup(
            jContentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 312, Short.MAX_VALUE)
        );
        jContentPanelLayout.setVerticalGroup(
            jContentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 113, Short.MAX_VALUE)
        );

        jCancelBtn.setText("Cancel");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(174, Short.MAX_VALUE)
                .addComponent(jCancelBtn)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jOkBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(4, 4, 4))
            .addComponent(jContentPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(jContentPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jCancelBtn)
                    .addComponent(jOkBtn))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jCancelBtn;
    private javax.swing.JPanel jContentPanel;
    private javax.swing.JButton jOkBtn;
    // End of variables declaration//GEN-END:variables

}
